package com.itheima.flowcontrol.loop;

/**
 * break语句和continue语句的使用
 */
public class BreakContinueDemo01 {
    public static void main(String[] args) {
        test1();
        test2();
    }

    private static void test2() {
        //continue语句使用
        for (int i = 0; i < 5; i++) {
            System.out.println("i = " + i);
            if (i == 3) {
                continue;
            }
            System.out.println("hello");

        }
    }

    private static void test1() {
        for (int i = 0; i < 3; i++) {
            //break的使用
            System.out.println("i=" + i);
            if(i == 2){
                break;
            }
            System.out.println("heLLO");

        }
    }
}
